<template>
  <view class="content">
    <view class="btn" v-if="curType == 1 && isSwitch">
      <button class="new" type="primary" @click="goToMyLine()">我的排号</button>
    </view>
    <uni-section type="line" v-if="curType == 1">
      <view class="example-body">
        <view v-for="item in titleLists" @click="clickItem(item.id)" :class="{ 'tag-view': true, active: item.checked }"
          :key="item.id">
          {{ item.text }}
          <view class="line"></view>
        </view>
      </view>
    </uni-section>
    <view v-if="curType == 1">
      <view v-if="checkItemId == 1">
        <top-search :showState="false" :showMore="false" :showCarNo="true" :showCustomer="false" :showSearch="false"
          :custList="custList" :rangeKey="rowKey" @bindChange="searchList" @confirmChange="confirmChange"></top-search>
        <view class="phxx-list">
          <view class="item" v-for="(item, index) in rowNumberData" :key="index">
            <row-number :type="1" :itemList="item"></row-number>
          </view>
          <uni-load-more :status="pageParams.isMore" />
        </view>
      </view>
      <view v-else>
        <top-search :showState="false" :showCarNo="true" :showMore="false" :showCustomer="false" :showSearch="false"
          :custList="custList" :rangeKey="rowKey" @bindChange="searchList" @confirmChange="confirmChange"></top-search>
        <view class="phxx-list">
          <view class="item" v-for="(item, index) in parkigDatas" :key="index" @click="showPopClick(item.id)">
            <row-number :type="2" :itemList="item"></row-number>
          </view>
          <uni-load-more :status="pageParams.isMore" />
        </view>
      </view>
    </view>

    <view v-if="curType == 2">
      <!-- 排号详情 -->
      <view class="map">
        <map-com @isDisStatus="handleDistance" ref="mapRefs" :itemData="waybillData"></map-com>
        <view v-if="
        (waybillData.waybillRespVO.waybillStatus == 10010 ||
        waybillData.waybillRespVO.waybillStatus == 10000 ||
        waybillData.waybillRespVO.waybillStatus == 40020) &&
        (goodsType == 'phurchase' ? orderStatus != 9 : orderStatus != 8)">
          <uni-section type="line">
            <uni-notice-bar background-color="#fffbe8" color="red" class="message"
              :style="waybillDialogDetailFlag ? 'bottom: 300px':'bottom: 20px'" single show-icon
              text="请先排号，等待叫号后才能入场！" />
          </uni-section>
        </view>
        <view class="tips-box">
          <view class="lineup">
            <view class="icon"></view>排队区域
          </view>
          <view class="nostop">
            <view class="icon"></view>禁停区域
          </view>
        </view>
        <view class="refresh-btn" @click="refreshMyData">手动刷新</view>
      </view>
      <view class="shousuo-up" @click="hidePopUp" v-if="showIcon">
        <image :src="contractupImg"></image>
      </view>

      <!-- 已排队(在途) 、已抢单/已预约 或 取消排队(在途) -->
      <view class="waybill-details" ref="waybillDialogDetail" v-show="waybillDialogDetailFlag">
        <view class="wpdformBg">
          <view class="shousuo" @click="hidePop">
            <view class="back back-left"></view>
            <view>
              <image :src="contractImg"></image>
            </view>
            <view class="back back-right"></view>
          </view>
          <view class="phxx" v-if="!currentStatus" style="width: 100%;white-space: nowrap ">
            <view>
              <view class="cph">{{
                waybillData.waybillRespVO.carBrand || ''
                }}</view>
              <view class="mz">{{
                waybillData.waybillRespVO.coalSubtypeName || ''
                }}</view>
            </view>
            <view v-if="payCallNotifyStatus != null" style="margin-left: calc(-4vw + 40px)">
              <view :class="{'red-type': needPayment, 'blue-type': !needPayment, status: true}">
                {{ payCallNotifyStatusName }}
              </view>
            </view>

            <view class="queue-num-status" style="position: relative;" :class="{
                'gray-type': waybillData.waybillRespVO.waybillStatus == 10000,
                'orange-type':
                  waybillData.waybillRespVO.waybillStatus == 30010 ||
                  (waybillData.waybillRespVO.waybillStatus >= 60020 &&
                    waybillData.waybillRespVO.waybillStatus <= 60040),
                'blue-type':
                  waybillData.waybillRespVO.waybillStatus == 10010 ||
                  waybillData.waybillRespVO.waybillStatus == 40010,
                'green-type':
                  waybillData.waybillRespVO.waybillStatus == 90000 ||
                  (waybillData.waybillRespVO.waybillStatus >= 40040 &&
                    waybillData.waybillRespVO.waybillStatus <= 60010),
                'red-type':
                  waybillData.waybillRespVO.waybillStatus == 40020 ||
                  waybillData.waybillRespVO.waybillStatus == 40030,
                status: true
              }">
              <text-tooltip v-if="waybillData.waybillRespVO.waybillStatus===40040" ref="textTooltipRef"
                :content="'该状态可入场'" :parentRef="$refs.textTooltipRef"></text-tooltip>
              {{ waybillData.waybillRespVO.waybillStatusName || '' }}
            </view>
          </view>
          <view class="mzxx">
            <view class="mk">
              <text v-if="goodsType === 'sale'">{{
                waybillData.waybillRespVO.customerName || ''
                }}</text>
              <text v-if="goodsType === 'phurchase'">{{
                waybillData.waybillRespVO.purchaserName || ''
                }}</text>
            </view>
            <view class="tips" @click="lineDetail">
              <view class="iconfont icon-shuoming menu-icon"></view>排号规则
            </view>
            <view class="mk" v-if="goodsType == 'sale'">{{
              waybillData.waybillRespVO.unLoadingSiteName || ''
              }}</view>
            <view class="mk" v-if="goodsType == 'phurchase'">{{
              waybillData.waybillRespVO.loadingSiteName || ''
              }}</view>
          </view>

          <view class="yjddss">
            <view class="item">
              <view class="til">预计等待时间</view>
              <view class="val">
                <font style="color: #f78600">{{ waybillData.hours || 0 }}</font>小时<font style="color: #f78600">{{
                  waybillData.minutes || 0
                  }}</font>分钟
              </view>
            </view>
            <view class="item">
              <view class="til">排号车辆</view>
              <view class="val">
                <font style="color: #f78600">{{
                  waybillData.currentLineupCount || 0
                  }}</font>辆
              </view>
            </view>
          </view>
          <view class="call-reminder-box"
            v-if="(waybillqueueStatus == 10010 || waybillqueueStatus == 10000 || waybillqueueStatus == 40020) && notifyCost > 0">
            <view class="tap-box" @click="checkBoxFun">
              <image v-if="servicePayFlag" :src="checkImg" style="width: 30rpx; height: 30rpx"></image>
              <image v-else :src="uncheckImg" style="width: 30rpx; height: 30rpx"></image>
              叫号提醒服务费{{ notifyCost }}元
            </view>
            <label class="iconfont icon-shuoming menu-icon" @click="showTips"></label>
          </view>

          <view class="call-reminder-box" v-if="waybillqueueStatus == 40010 && needPayment && notifyCost > 0"
            style="background-color: #fcebbc;color: #F78600;">
            <view class="tap-box" @click="checkBoxNotifyFun">
              <image v-if="servicePayFlag" :src="checkOrangeImg" style="width: 45rpx; height: 45rpx"></image>
              <image v-else :src="uncheckImg" style="width: 45rpx; height: 45rpx"></image>
              叫号提醒服务费{{ notifyCost }}元
            </view>
            <label class="iconfont icon-shuoming menu-icon" @click="showTips"></label>
          </view>
          <view class="btn-box" v-if="isNeedLineup && isNotifyShow">
            <view v-if="waybillStatusPay" class="payment-box">支付失败，重新支付</view>
            <button :class="{ loading: isLoading }" type="primary" v-if="
                waybillStatusName == 1 && waybillData.waybillRespVO.waybillStatus == 40010
              " plain size="default" @click="isNotifyShowClick">
              去支付（{{totalPrice}}）元
              <view v-if="isLoading" class="loading-icon"></view>
            </button>
          </view>
          <view class="btn-box" v-if="isNeedLineup">
            <view v-if="waybillStatusPay" class="payment-box">支付失败，重新支付</view>
            <button :class="{ loading: isLoading }" type="primary" v-if="
                waybillStatusName == 1 &&
                (waybillqueueStatus == 10000 ||
                  waybillqueueStatus == 10010 ||
                  waybillqueueStatus == 40020 ||
                  waybillqueueStatus == 30010)
              " plain size="default" @click="handlePaiduiConfirm">
              {{ priceNumText }}
              <view v-if="isLoading" class="loading-icon"></view>
            </button>
          </view>
        </view>
      </view>
      <!-- 已完成 -->
      <view class="waybill-details" ref="waybillFinishDialog" v-show="waybillFinishDialogFlag">
        <view class="wpdformBg">
          <view class="shousuo" @click="hidePop">
            <image :src="contractImg"></image>
          </view>

          <view class="phxx">
            <view>
              <view class="cph">{{
                waybillData.waybillRespVO.carBrand || ''
                }}</view>
              <view class="mz">{{
                waybillData.waybillRespVO.coalSubtypeName || ''
                }}</view>
            </view>
            <view :class="{
                'gray-type': waybillData.waybillRespVO.waybillStatus == 10000,
                'orange-type':
                  waybillData.waybillRespVO.waybillStatus == 30010 ||
                  (waybillData.waybillRespVO.waybillStatus >= 60020 &&
                    waybillData.waybillRespVO.waybillStatus <= 60040),
                'blue-type':
                  waybillData.waybillRespVO.waybillStatus == 10010 ||
                  waybillData.waybillRespVO.waybillStatus == 40010,
                'green-type':
                  waybillData.waybillRespVO.waybillStatus == 90000 ||
                  (waybillData.waybillRespVO.waybillStatus >= 40040 &&
                    waybillData.waybillRespVO.waybillStatus <= 60010),
                'red-type':
                  waybillData.waybillRespVO.waybillStatus == 40020 ||
                  waybillData.waybillRespVO.waybillStatus == 40030,
                status: true
              }">
              {{ waybillData.waybillRespVO.waybillStatusName || '' }}</view>
          </view>

          <view class="mzxx">
            <view class="mk" v-if="goodsType == 'sale'">
              {{ waybillData.waybillRespVO.customerName || '' }}
            </view>
            <view class="mk" v-if="goodsType == 'phurchase'">{{
              waybillData.waybillRespVO.purchaserName || ''
              }}</view>
            <view class="mk" v-if="goodsType == 'sale'">{{
              waybillData.waybillRespVO.unLoadingSiteName || ''
              }}</view>
            <view class="mk" v-if="goodsType == 'phurchase'">{{
              waybillData.waybillRespVO.loadingSiteName || ''
              }}</view>

            <view class="mk">
              <view class="cph">车牌号</view>{{ waybillData.waybillRespVO.carBrand || '' }}
            </view>
            <view class="mk">
              <view class="cph">司机姓名</view>{{ waybillData.waybillRespVO.carName || '' }}
            </view>
            <view class="mk">
              <view class="cph">手机号</view>{{ waybillData.waybillRespVO.carPhone || '' }}
            </view>
            <view class="mk" v-if="waybillData.waybillRespVO.planType == 2">
              <view class="cph">磅单信息</view>
              <view class="img-box">
                <image class="cover-img" @click="clickImg" :src="imagesPath[0]" mode="aspectFill"></image>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 停车场列表数据详情 -->
    <view v-show="parkigDetailFlag">
      <view class="back-meng" @click="hidePopClick()"></view>
      <view class="waybill-details" ref="parkigDialogDetail">
        <view class="wpdformBg1">
          <view class="phxx">
            <view>
              <view class="cph">{{
                parkigData.queueInfoVO.vehicleNo || ''
                }}</view>
              <view class="mz">{{
                parkigData.queueInfoVO.purchaseCoalName || ''
                }}</view>
            </view>
            <view :class="{
                'gray-type': parkigData.queueInfoVO.queueStatus == 50021,
                'orange-type': parkigData.queueInfoVO.queueStatus == 50010,
                'blue-type': parkigData.queueInfoVO.queueStatus == 50020,
                'green-type': parkigData.queueInfoVO.queueStatus == 50030,
                'red-type': parkigData.queueInfoVO.queueStatus == 10000,
                status: true
              }">
              {{ parkigData.queueInfoVO.queueStatusName || '' }}
            </view>
          </view>
          <view class="mzxx">
            <view class="mk">
              {{ parkigData.queueInfoVO.purchaserName || '' }}
            </view>
            <view class="mk">
              {{ parkigData.queueInfoVO.supplierName || '' }}
            </view>
          </view>

          <view class="yjddss">
            <view class="item">
              <view class="til">预计等待时间</view>
              <view class="val">
                <font style="color: #f78600">{{ parkigData.hours || 0 }}</font>小时<font style="color: #f78600">{{
                  parkigData.minutes || 0
                  }}</font>分钟
              </view>
            </view>
            <view class="item">
              <view class="til">排号车辆</view>
              <view class="val">
                <font style="color: #f78600">{{
                  parkigData.parkingCount || 0
                  }}</font>辆
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>

    <!-- 排号规则弹窗 -->
    <uni-popup ref="lineRulePop">
      <view class="pop">
        <view class="phxx-itemss">
          <view class="header">
            <view class="title">排号规则</view>
          </view>
          <view class="top">
            <view class="tit">
              1、车辆进入<font style="color: blue">排号区域</font>即可进行排号。
            </view>
            <view class="tit">
              2、排号成功后，请合理安排时间等待叫号进场通知。
            </view>
            <view class="tit">
              3、收到叫号进场通知后，需要在规定时间内入场。
            </view>
            <view class="tit"> 4、若未及时入场，则需要重新排队。 </view>
            <view class="tit" v-if="goodsType == 'phurchase'">
              5、<font style="color: red">禁停区域</font>禁止入内。
            </view>
            <view class="tit" v-if="goodsType == 'sale'">
              5、<font style="color: red">禁停区域</font>禁止入内
              <text v-if="violationPunish===1 && isLimit===1">，驶入<font style="color: red">
                  禁停区域</font>将自动取消排队。
              </text>
              <text v-else>。</text>
            </view>
          </view>
          <view class="btn">
            <view class="title" @click="closeLinepop">我知道了</view>
          </view>
        </view>
      </view>
    </uni-popup>
    <!-- 服务费规则弹窗 -->
    <uni-popup ref="serviceRulePop">
      <view class="pop">
        <view class="phxx-itemss">
          <view class="header">
            <view class="title">叫号提醒服务费说明</view>
          </view>
          <view class="top">
            <view class="tit"> 1、提醒服务为电话提醒，每单提醒为两次。 </view>
            <!-- <view class="tit">
              2、第一次前方排队剩余{{ carNums || 0 }}辆车时提醒。
            </view> -->
            <view class="tit"> 2、第一次当您可入场时提醒。 </view>
            <view class="tit">
              3、第二次可入场已过{{ carwatingMinutes || 0 }}分钟未入场时提醒。
            </view>
          </view>
          <view class="btn">
            <view class="title" @click="closeServicepop">我知道了</view>
          </view>
        </view>
      </view>
    </uni-popup>
    <!-- 确认弹窗 -->
    <uni-popup class="linePaymentPop" ref="linePaymentPop">
      <view class="payconfirmBox">
        <view class="main-box">
          <view class="top">
            <view @click="exit">X</view>
            <view class="title" v-if="isNotifyShow">叫号提醒</view>
            <view class="title" v-else>排号</view>
            <view class="btn" @click="chargeFun">充值</view>
          </view>
          <view class="content">
            <view class="money"> ￥{{ totalPrice }}元 </view>
            <view class="showing">
              <view>付款方式</view>
              <view>钱包支付</view>
            </view>
          </view>
        </view>
        <view class="btn-box" v-if="isNotifyShow">
          <button class="agreeBtn" :class="{ loading: isLoading }" type="primary" size="default"
            @click="handlePaiduihouPayment">
            确认支付
            <view v-if="isLoading" class="loading-icon"></view>
          </button>
        </view>
        <view class="btn-box" v-else>
          <button class="agreeBtn" :class="{ loading: isLoading }" type="primary" size="default"
            @click="handlePaiduiPayment">
            确认排号
            <view v-if="isLoading" class="loading-icon"></view>
          </button>
        </view>
      </view>
    </uni-popup>
    <uni-popup class="jdcgPop" ref="jdcgPop" :mask-click="false">
      <view class="top">
        <view class="title-box">
          <view class="tit1">
            <image :src="imagesSuccess" class="logo" mode="widthFix"></image>
          </view>
          <view class="title">
            车辆<font style="color: #409efe">【{{ carBrand }}】</font>接单成功！
          </view>
          <view class="tit1"> 车辆进入蓝色区域请尽快在小程序签到排号，<font style="color: red">未排号或未叫号车辆将无法入场</font>
          </view>
        </view>
        <view class="body">
          <view class="tit"> 温馨提示： </view>
          <view class="tit">
            <view class="dat"><text></text></view>
            <font style="color: #000000"> 请务必携带有效身份证，否则会无法入场过磅。</font>
          </view>
          <view class="tit">
            <view class="dat"><text></text></view>
            <font style="color: #000000">如需审核请及时联系货主审核运单。</font>
          </view>
          <view class="tit">
            <view class="icon">
              <view class="icon-inner"></view>
            </view>
            <font style="color: #409EFE">蓝色区域</font>为排队区域。
          </view>
          <view class="tit">
            <view class="icon">
              <view class="icon-inner"></view>
            </view>
            <font style="color: #FF4D4F">红色区域</font>为禁停区域（未叫号禁止入内）。
          </view>
          <view class="tit">
            收到叫号进场通知，请在规定时间入场，否则将自动作废。关注公众号【神煤交易智慧计量】及时获取信息！
          </view>
        </view>

        <view class="btn">
          <button type="primary" plain size="default" :disabled="isCounting" :class="{ 'disabled-button': isCounting }"
            @click="confirmJieDan">
            {{ isCounting ? `确认 (${countdown}s)` : '确认' }}
          </button>
        </view>
      </view>
    </uni-popup>
    <!-- 处罚提示弹窗 -->
    <uni-popup ref="messShow" mode="center" width="300rpx" border-radius="20" background-color="#fff"
      :mask-close-able="false">
      <view class="tipsBox">
        <view class="tipsHeader"> 提示 </view>
        <view class="tipsDesc"> 驶入禁停区域多次，排号已自动取消！ </view>
        <view class="messBtn">
          <button class="btn" type="primary" @click="closeTipsWin()">
            确认
          </button>
        </view>
      </view>
    </uni-popup>
  </view>
</template>
<script>
  import func from '@/utils/funlogin.js';
  import {
    setTenantId,
    getOpenId,
    getTenantId,
    getAccessToken,
    getWayBillNo,
    setWayBillNo,
    removeWayBillNo,
    setToken,
    setDriverId
  } from '@/utils/auth';
  import {
    getOpenIdByCode,
    getTenantsByOpenId,
    getPhoneByOpenid,
    wxPhoneLogin
  } from '@/api/login.js';
  import { getWalletBalance } from '@/api/system/user.js';
  import { getDriverMoney, payLineupCost, callNotifyPay } from '@/api/system/waybill.js';
  import {
    getCustList,
    getLineUpByDriver,
    getDriving,
    checkRuningCar,
    getWayBillDetail,
    getLineUpDetail,
    getWayBillDetailLatest,
    getWayBillDetailForDriver,
    getProductsLists,
    getTransPlanDetail,
    getVehicle,
    addWaybillLists,
    getParkingLists,
    creatLineUp,
    getTenantConfig,
    updateViolation,
    addViolation,
    paymentReq,
    cancelQueue,
    getConfigData,
    getStopAreaLimit,
    getParkingDetail,
    findLineupSwitchByTenant,
    getDictDatas
  } from '@/api/me.js';
  import { toast, getCurrenDate, dictTansParams } from '@/utils/common';
  import config from '@/config';

  export default {
    data() {
      return {
        orderStatus: undefined,
        payCallNotifyStatusList: [],
        payCallNotifyStatus: null,
        payCallNotifyStatusName: undefined,
        isNotifyShow: false,
        countdown: 5, // 倒计时秒数
        isCounting: false, // 是否正在倒计时
        errorMsg: undefined,
        carwatingMinutes: 0,
        isLoading: false,
        carNums: 0,
        showIcon: true, //地图底部的面板展开按钮
        checkItemId: 1,
        waybillqueueStatus: null,
        lineupId: null,
        goodsType: undefined,
        servicePayFlag: false,
        totalPrice: 0,
        titleLists: [
          {
            id: 1,
            text: '在途排队',
            checked: true
          },
          {
            id: 2,
            text: '停车场排队',
            checked: false
          }
        ],
        carBrand: '',
        waybDialog: false,
        coalmineFlag: false,
        curDateTime: '',
        curDateTime2: '',
        poundListFlag: false,
        switchText: '我的排号',
        isNeedLineup: true,
        planId: undefined,
        datetimesingle: undefined,
        datetimesingle2: undefined,
        prodWeight: undefined,
        waybillDialogFlag: false,
        waybillDialogDetailFlag: false,
        parkigDetailFlag: false,
        waybillFinishDialogFlag: false,
        refreshFlag: false,
        showCard: false,
        contractImg: config.baseImgUrl + '/contract-up.svg',
        contractupImg: config.baseImgUrl + '/contract.svg',
        currentStatus: false,
        loading: false,
        imagesDefaultPath: config.baseImgUrl + '/img.png',
        waybillStatusName: 0,
        isPdDistance: false,
        imagesPath: [],
        imagesPath2: [],
        isJieDan: false,
        imagesDefaultPath2: config.baseImgUrl + '/img.png',
        carListFlag: false,
        jTNum: 0,
        waybillStatusPay: false,
        hasLoadPage: false, // 上传照片 onshow
        vehicleList: [],
        selectedCar: '',
        selectedProd: undefined,
        ysjhData: '', // 从接单而来的参数
        currentWIndow: '',
        waybillData: {
          waybillRespVO: {
            id: '',
            planNo: '',
            customerName: '',
            purchaserName: '',
            enterId: '',
            openId: '',
            supplierName: '',
            waybillNo: '',
            planType: 1,
            planTypeName: '',
            loadingSiteId: undefined,
            loadingSiteName: '',
            unLoadingSiteId: undefined,
            unLoadingSiteName: undefined,
            bizType: 0,
            carBrand: '',
            carCard: '',
            driverId: '',
            carName: '',
            carPhone: '',
            dateDb: '',
            driverWeight: 0,
            proId: '',
            supId: '',
            userId: undefined,
            uuid: ''
          },
          hours: 0,
          minutes: 0,
          currentLineupCount: 0,
          enableStatus: undefined //状态
        },
        currentDetailId: null,
        parkigData: {
          queueInfoVO: {
            id: '',
            vehicleNo: '',
            purchaseCoalName: '',
            queueStatusName: '',
            purchaserName: '',
            supplierName: '',
            customerName: ''
          },
          hours: 0,
          minutes: 0,
          parkingCount: 0
        },
        haveOpt: 0, //默认进入这个页面有options传参
        priceNum: 0,
        priceNumText: '排号',
        needPayment: false,
        sjjdFormData: {},
        waybillNo: '',
        preLineupNo: '',
        imageStyles: {
          width: 100,
          height: 100
        },
        cuttentType: '',
        payParam: {
          timeStamp: '',
          paySign: '',
          nonceStr: '',
          package: ''
        },
        // toastMessge: '',
        custList: [],
        supId: undefined,
        curType: 0,
        rowNumberData: [],
        rowKey: ['customerName', 'waybillStatusName'],
        wayBillStatusList: [],
        queryParam: {
          pageNo: 1,
          pageSize: 5,
          vehicleNo: undefined,
          startTime: undefined,
          endTime: undefined
        },
        queryParamParking: {
          pageNo: 1,
          pageSize: 5,
          vehicleNo: ''
        },
        notifyCost: 0,
        parkigDatas: [],
        pageParams: {
          isMore: 'noMore'
        },
        lineupSwitch: 1,
        saleLineupSwitch: 1,
        violationPunish: 0,
        isLimit: 0
      };
    },
    computed: {
      imagesSuccess() {
        if (this.$store.state.user.curTypeColor == '#D22C2C') {
          return config.baseImgUrl + '/sucess1.png';
        } else if (this.$store.state.user.curTypeColor == '#409EFE') {
          return config.baseImgUrl + '/sucess.png';
        } else {
        }
      },
      checkImg() {
        if (this.$store.state.user.curTypeColor == '#D22C2C') {
          return config.baseImgUrl + '/checked1.png';
        } else if (this.$store.state.user.curTypeColor == '#409EFE') {
          return config.baseImgUrl + '/checked.png';
        } else {
          return config.baseImgUrl + '/checked.png';
        }
      },
      checkOrangeImg() {
        return config.baseImgUrl + '/checkOrangeImg3x.png';
      },
      uncheckImg() {
        return config.baseImgUrl + '/unchecked.png';
      },
      isSwitch() {
        return this.lineupSwitch === 0 || this.saleLineupSwitch === 0
      }
    },
    // mounted() {
    //   this.startCountdown(); // 页面加载时启动倒计时
    // },
    methods: {
      hidePopClick() {
        this.parkigDetailFlag = false;
      },
      async findLineupSwitchByTenant() {
        const res = await findLineupSwitchByTenant(getTenantId());
        if (res.code === '200') {
          // 在途排队开关
          this.lineupSwitch = res.data.lineupSwitch
          this.saleLineupSwitch = res.data.saleLineupSwitch
        }
      },
      async showPopClick(id) {
        if (this.parkigDetailFlag && this.currentDetailId === id) {
          this.parkigDetailFlag = false;
          return;
        }
        if (!id) {
          return;
        }
        const res = await getParkingDetail(id);
        if (res.code === 0) {
          this.parkigData.queueInfoVO.vehicleNo =
            res.data.queueInfoVO.vehicleNo;
          this.parkigData.queueInfoVO.purchaserName =
            res.data.queueInfoVO.purchaserName;
          this.parkigData.queueInfoVO.queueStatus =
            res.data.queueInfoVO.queueStatus;
          this.parkigData.queueInfoVO.queueStatusName =
            res.data.queueInfoVO.queueStatusName;
          this.parkigData.queueInfoVO.purchaserName =
            res.data.queueInfoVO.purchaserName;
          this.parkigData.queueInfoVO.purchaseCoalName =
            res.data.queueInfoVO.purchaseCoalName;
          this.parkigData.queueInfoVO.supplierName =
            res.data.queueInfoVO.supplierName;
          this.parkigData.queueInfoVO.customerName =
            res.data.queueInfoVO.customerName;
          this.parkigData.hours = res.data.hours;
          this.parkigData.minutes = res.data.minutes;
          this.parkigData.parkingCount = res.data.parkingCount;
          this.currentDetailId = id;
          this.parkigDetailFlag = true;
        } else {
          toast(res.msg);
        }
      },
      showTips() {
        this.$refs['serviceRulePop'].open();
      },
      closeServicepop() {
        this.$refs['serviceRulePop'].close();
      },
      checkBoxFun() {
        this.servicePayFlag = !this.servicePayFlag;
        if (this.servicePayFlag) {
          //变更价格
          this.totalPrice = parseFloat(
            Number(this.priceNum) + Number(this.notifyCost)
          ).toFixed(2);
          this.priceNumText = `排号（${this.totalPrice}元）`;
        } else {
          if (Number(this.priceNum) != 0) {
            this.totalPrice = this.priceNum;
            this.priceNumText = `排号（${this.totalPrice}元）`;
          } else {
            this.priceNumText = `排号`;
          }
        }
      },
      checkBoxNotifyFun() {
        this.servicePayFlag = !this.servicePayFlag;
        this.isNotifyShow = this.servicePayFlag;
        if (this.servicePayFlag) {
          //变更价格
          this.totalPrice = parseFloat(
            Number(this.priceNum) + Number(this.notifyCost)
          ).toFixed(2);
        } else {
          if (Number(this.priceNum) != 0) {
            this.totalPrice = this.priceNum;
          }
        }
      },
      isNotifyShowClick() {
        this.$refs['linePaymentPop'].open('bottom');
      },
      closeTipsWin() {
        this.$refs['messShow'].close();
      },
      clickItem(id) {
        this.parkigDetailFlag = false;
        this.titleLists.forEach((item) => {
          item.checked = false;
          if (item.id == id) item.checked = true;
        });
        this.checkItemId = id;
        if (id == 1) {
          this.getRowList();
        } else {
          this.getParkingList();
        }
      },
      async getTenConfig() {
        let res = await getTenantConfig();
        if (res.code === 0) {
          return res.data.parkingEnableStatus === 0;
        } else {
          return false;
        }
      },
      async getParkingList() {
        this.parkigDetailFlag = false;
        let flag = await this.getTenConfig();
        if (!flag) {
          wx.stopPullDownRefresh();
          return;
        }
        try {
          //遍历对象过滤空值
          this.pageParams.isMore = 'loading';
          let data = {};

          data = this.queryParamParking;
          let res = await getParkingLists(data);
          if (res.code == 0) {
            if (this.queryParamParking.pageNo == 1) {
              this.parkigDatas = res.data.list;
            } else {
              this.parkigDatas = [...this.parkigDatas, ...res.data.list];
            }
            if (res.data.total == this.parkigDatas.length) {
              this.pageParams.isMore = 'noMore';
            } else {
              this.pageParams.isMore = 'more';
            }
          } else {
            this.parkigDatas = [];
            this.pageParams.isMore = 'noMore';
          }
          wx.stopPullDownRefresh();
        } catch (e) {
          return false;
        }
      },
      onConfirm(res, type) {
        this.datetimesingle = res.result;
        this.poundListFlag = false;
      },
      onCancel() {
        this.poundListFlag = false;
      },
      onConfirm2(res, type) {
        this.datetimesingle = res.result;
        this.poundListFlag = false;
      },
      onCancel2() {
        this.poundListFlag = false;
      },
      exit() {
        this.$refs['linePaymentPop'].close();
      },
      getLinePay(price) {
        this.priceNum = parseFloat(price / 100).toFixed(2);
        this.totalPrice = this.priceNum;
        if (this.priceNum > 0) {
          this.priceNumText = `排号（${this.priceNum}元）`;
        }
      },
      cancelFirm() {
        this.$refs['payConfirmShow'].close();
      },
      handleWaybillStatus(status) {
        this.priceNumText = status;
      },
      handlePaiduiPaymentTest() {
        wx.requestPayment({
          provider: 'wxpay', //支付类型-固定值 这里是微信支付
          timeStamp: '1702540322',
          package: `prepay_id=wx1415520282423139e178009a785fe80000`,
          paySign:
            'Kg3OAI/oYlmeZ6bn7b8wA1SXWzxabi13gP/y6owFYEdiOaNmTArgOdJYnIj6NkbiU3yGOb3OqKfxq88apjpES+G2f6CU0qPsQn7bcQ7xuEBylw1e7p+W1Wi4/AGpe+3fl8dkHgZZApoUPurk8Bwp0uQUthcrf7CLIMgIdNq3ZUyTUCDE8U+zLpUKxi2jc+TjD2Rf1kZaJdUw7Jyd9fVlgbO36nQykE3G9o0bLlsEwQHo2Hn8C2etnOY2sWBlsl8iABiKa7OGbSoOmt+yazTtqhvYcEHRYnu6Y2O1SEQP/aIIIW4EF6LmIO8qchdbqnKYrcXIZYLKIexzW9LsZBkrjg==',
          appId: 'wx509f810f5fb82353',
          signType: 'RSA',
          nonceStr: 'C0t7zfIMDP54S5w7EHt3eWqL76Awtdip',
          success: function (res) {
            console.log('支付费用后的调用成功==', res);
          },
          fail: function (res) {
            console.log('支付费用后的调用失败==', res);
            // this.handleWaybillStatus('排号(支付中...)')
          },
          complete: function (res) {
            console.log('支付费用后的调用完成==', res);
          }
        });
      },
      async handlePaiduiPayment() {
        try {
          let _this = this;
          if (this.isLoading) return;
          this.isLoading = true;
          let resBalance = await getDriverMoney();
          if (resBalance.code == 0) {
            if (resBalance.data.balance < Number(this.totalPrice)) {
              //2.余额不够，跳转到充值界面
              toast('钱包余额不足，请充值');
            } else {
              //1.余额足够：排号
              await this.handlePaidui();
              this.exit()
              // let resBalance = await payLineupCost({
              //   waybillNo: this.waybillNo,
              //   // preLineupNo: this.preLineupNo,
              //   waybillType: uni.getStorageSync('orderType'),
              //   lineupCost: Number(this.priceNum) * 100,
              //   notifyCost: this.servicePayFlag ? Number(this.notifyCost) * 100 : 0
              // });
              // if (resBalance.code == 0) {
              //   await this.handlePaidui();
              //   this.exit()
              // } else {
              //   toast(resBalance.msg);
              //   if (resBalance.code == 100313019) {
              //     await this.handlePaidui();
              //   } else {
              //     this.refreshMyData();
              //   }
              // }
            }
          } else {
            toast('获取司机账户余额失败');
          }
        } finally {
          setTimeout(() => {
            this.isLoading = false;
          }, 1000)
        }

      },
      //排号后支付叫号提醒费用
      async handlePaiduihouPayment() {
        try {
          let _this = this;
          if (this.isLoading) return;
          this.isLoading = true;
          let resBalance = await getDriverMoney();
          if (resBalance.code == 0) {
            if (resBalance.data.balance < Number(this.totalPrice)) {
              //2.余额不够，跳转到充值界面
              toast('钱包余额不足，请充值');
            } else {
              //1.余额足够：直接扣钱包余额
              let resBalance = await callNotifyPay({
                lineupId: this.lineupId,
                notifyCost: this.servicePayFlag ? Number(this.notifyCost) * 100 : 0
              });
              if (resBalance.code == 0) {
                if (uni.getStorageSync('orderType')) {
                  this.getLatestWayBill('');
                }
                this.exit()
                this.isNotifyShow = false
                toast('支付叫号提醒费用成功');
              } else {
                toast(resBalance.msg);
                this.refreshMyData();
              }
            }
          } else {
            toast('获取司机账户余额失败');
          }
        } finally {
          setTimeout(() => {
            this.isLoading = false;
          }, 1000)
        }

      },
      clickImg() {
        let _this = this;
        _this.refreshFlag = true;
        let imgsArray = [];
        uni.previewImage({
          urls: [this.imagesPath[0]]
        });
      },
      clickImg2() {
        let _this = this;
        _this.refreshFlag = true;
        let imgsArray = [];
        uni.previewImage({
          urls: [this.imagesPath[0]]
        });
      },
      refreshMyData() {
        this.waybillNo = getWayBillNo()?.waybillNo;
        if (!!this.waybillNo) {
          //有运单编号
          this.getWayBillDetails(this.waybillNo, '');
        } else {
          //没有运单编号
          if (uni.getStorageSync('orderType')) {
            this.getLatestWayBill('');
          }
        }
      },
      hidePop() {
        this.showCard = true;
        //关闭当前窗口
        // this.$refs[this.currentWIndow].close();
        if (this.currentWIndow == 1) {
          this.waybillDialogFlag = false;
        } else if (this.currentWIndow == 2) {
          this.waybillDialogDetailFlag = false;
        } else {
          this.waybillFinishDialogFlag = false;
        }
      },
      closeLinepop() {
        this.$refs['lineRulePop'].close();
      },
      chargeFun() {
        //TODO
        this.$tab.navigateTo(
          '/packageB/pages/mine/my-wallet/recharge?lineCharge=code'
        );
      },
      hidePopUp() {
        if (!!this.errorMsg) {
          toast(`${this.errorMsg}`);
          return;
        }
        this.showCard = false;
        //打开当前窗口
        // this.$refs[this.currentWIndow].open('bottom');
        if (this.currentWIndow == 1) {
          this.waybillDialogFlag = true;
        } else if (this.currentWIndow == 2) {
          this.waybillDialogDetailFlag = true;
        } else {
          this.waybillFinishDialogFlag = true;
        }
      },
      lineDetail() {
        this.$refs['lineRulePop'].open();
      },
      toggleShowCard() {
        this.showCard = true;
      },
      // 处理排队区域
      async handleDistance(dis) {
        // const pages = getCurrentPages();
        // const currentPage = pages[pages.length - 1];
        // if (currentPage.route && currentPage.route.indexOf('pages/index') == -1) {
        //   return;
        // }
        if (this.curType == 1) {
          return;
        }
        //不在禁停区域内
        if (!dis.isJtDistance) {
          uni.setStorageSync('jTNum', 0);
          // 是否在排队区域内
          this.isPdDistance = dis.isPdDistance
          return
        }
        //暂时进入禁停后的逻辑
        this.isPdDistance = false;
        //40010：已排队在途
        if (this.waybillData.waybillRespVO.waybillStatus != 40010) {
          return;
        }
        if (uni.getStorageSync('orderType')) {
          this.violationsCancel();
          //在禁停区域内
          let jTNum = uni.getStorageSync('jTNum');
          jTNum++;
          console.log('jTNum++', jTNum)
          uni.setStorageSync('jTNum', jTNum);
        }
      },
      async addViolations(data) {
        //计入违规名单
        let param = {
          vehicleNo: data.vehicleNo,
          driverName: data.driverName,
          driverMobile: data.driverMobile,
          violationType: 2,
          violationTime:
            new Date().getFullYear() +
            '-' +
            (new Date().getMonth() + 1) +
            '-' +
            new Date().getDate() +
            ' ' +
            new Date().getHours() +
            ':' +
            new Date().getMinutes() +
            ':' +
            new Date().getSeconds(),
          violationLocation: '', //TODO
          violationDescription: '禁停区域停留时间太长',
          handleStatus: 1
        };
        try {
          let res = await addViolation(param);
          if (res.code == 0) {
            uni.setStorageSync('violationId', res.data);
            uni.showToast({
              type: 'error',
              title: `由于在禁停区域停留太长事件，您已被加入违规名单！`
            });
          }
        } catch (e) {
          return false;
        }
      },
      async violationsCancel() {
        //违规取消排队
        const res = await getConfigData({
          queueType: uni.getStorageSync('orderType')
        });
        if (res.code !== 0) {
          return
        }
        this.violationPunish = res.data?.violationPunish
        if (this.violationPunish === 0) {
          if (uni.getStorageSync('jTNum') == 3) {
            toast('您已驶入禁停区域，请立即驶离');
          }
          return
        }
        if (uni.getStorageSync('orderType') == 2) {
          setTimeout(() => {
            this.getStopAreaLimit()
          }, 2000)
          return
        }
        if (uni.getStorageSync('orderType') == 1 && uni.getStorageSync('jTNum') == 5) {
          this.cancelQueue()
          return
        }
      },
      async getStopAreaLimit() {
        const data = {
          queueType: uni.getStorageSync('orderType'),
          vehicleNo: this.waybillData.waybillRespVO.carBrand
        }
        const res = await getStopAreaLimit(data)
        if (res.code !== 0) {
          toast(res.msg);
          return
        }
        this.isLimit = res.data
        if (this.showStopAreaLimitTip(this.isLimit)) {
          return
        }
        if (this.isLimit === 1 && uni.getStorageSync('jTNum') == 5) {
          //自动取消排号
          this.cancelQueue()
          return
        }
      },
      showStopAreaLimitTip(status) {
        if (status === 0) {
          if (uni.getStorageSync('jTNum') == 3) {
            toast('您已驶入禁停区域，请立即驶离');
          }
          return true
        }
        if (status === 1 && uni.getStorageSync('jTNum') == 3) {
          toast('您已驶入禁停区域，请立即驶离，否则将取消排号');
          return true
        }
        return false
      },
      async cancelQueue() {
        const data = {
          id: uni.getStorageSync('waybillResId'),
          remarks: '驶入禁停区域，排号已自动取消'
        };
        const res = await cancelQueue(data);
        if (res.code !== 0) {
          toast(res.msg);
          return
        }
        this.$refs['messShow'].open();
        this.refreshMyData();
        uni.setStorageSync('jTNum', 0);
      },
      // 获取租户配置
      async gettenantConfig() {
        try {
          let res = await getTenantConfig();
          if (res.code == 0) {
            if (uni.getStorageSync('orderType') == 1) {
              this.carNums = res.data.surplusVehicles;
              this.carwatingMinutes = res.data.callPastTime;
            }
            if (uni.getStorageSync('orderType') == 2) {
              this.carNums = res.data.saleSurplusVehicles;
              this.carwatingMinutes = res.data.saleCallPastTime;
            }
          }
        } catch (e) {
          return false;
        }
      },
      startCountdown() {
        const hasCountdown = uni.getStorageSync('hasCountdown');
        if (!hasCountdown) {
          this.isCounting = true;
          const timer = setInterval(() => {
            if (this.countdown > 0) {
              this.countdown--;
            } else {
              this.isCounting = false;
              clearInterval(timer);

              // 倒计时结束后，设置标记
              uni.setStorageSync('hasCountdown', true);
            }
          }, 1000);
        }
      },
      confirmJieDan() {
        if (this.isCounting) return; // 倒计时期间不可点击
        uni.removeStorageSync('ysjhData');
        this.$refs['jdcgPop'].close();
        //当前排号页面展示已接单的面板
        if (uni.getStorageSync('orderType')) {
          this.getLatestWayBill('');
        }
      },
      //接单生成运单
      async handleJieDan() {
        this.waybillData.waybillRespVO.carBrand = this.selectedCar;
        //校验参数
        if (!this.waybillData.waybillRespVO.carBrand) {
          uni.showToast({
            title: `请选择车辆`
          });
          return;
        }
        if (!this.datetimesingle) {
          uni.showToast({
            title: `磅单时间必须为年-月-日 时-分-秒`
          });
          return;
        }
        if (!this.prodWeight) {
          uni.showToast({
            title: `净重不能为空`
          });
          return;
        }
        if (
          !this.waybillData.waybillRespVO?.uuid &&
          !this.imagesPath[0] &&
          this.waybillData.waybillRespVO?.planType == 1
        ) {
          uni.showToast({
            title: `请上传磅单照片`
          });
          return;
        }
        this.waybillData.waybillRespVO.uuid = this.imagesPath[0];
        this.waybillData.waybillRespVO.customerName = undefined;
        this.waybillData.waybillRespVO.containerNo = undefined;
        this.waybillData.waybillRespVO.supId = uni.getStorageSync('supIdFlag');
        this.waybillData.waybillRespVO.driverWeight = Number(this.prodWeight);
        this.waybillData.waybillRespVO.dateDb = this.datetimesingle;
        this.waybillData.waybillRespVO.waybillNo = undefined;
        this.waybillData.waybillRespVO.userId = uni.getStorageSync('curUserId');
        this.waybillData.waybillRespVO.enterId = getTenantId();
        this.waybillData.waybillRespVO.openId = getOpenId();
        this.waybillData.waybillRespVO.planNo = this.planId;
        this.waybillData.waybillRespVO.planTypeName =
          this.waybillData.waybillRespVO.planType == 1 ? '采购计划' : '销售计划';
        try {
          let res = await addWaybillLists(this.waybillData.waybillRespVO);
          if (res.code == '200') {
            uni.removeStorageSync('supIdFlag');
            this.waybillDialogFlag = false;
            setWayBillNo(this.waybillData.waybillRespVO.waybillNo);
            // this.$refs['jdcgPop'].open('bottom');
            // this.startCountdown()
          } else {
            toast(`${res.msg}`);
          }
        } catch (e) {
          return false;
        }
      },
      handleProd(item) {
        this.selectedProd = item.proName;
        this.waybillData.waybillRespVO.proId = item.proId;
        this.$refs['prodPopup'].close();
      },
      async handleCar(item) {
        //先去校验该车辆是否有正在执行中的运单
        let res = await checkRuningCar({
          vehicleNo: item.vehicleNo,
          enterId: getTenantId()
        });
        if (res.code != '200') {
          toast(`${res.msg}`);
          return;
        }
        this.selectedCar = item.vehicleNo;
        this.waybillData.waybillRespVO.carBrand = item.vehicleNo;
        this.checkCarAndImagNull();
        uni.setStorageSync('vehicleNoByCode', item.vehicleNo);
        this.$refs['popup'].close();
      },
      checkCarAndImagNull() {
        this.loading =
          this.waybillData.waybillRespVO?.planType == 1
            ? !!this.waybillData.waybillRespVO.carBrand
              ? true
              : false
            : !!this.waybillData.waybillRespVO.carBrand &&
              !!this.waybillData.waybillRespVO.uuid
              ? true
              : false;
      },
      open() {
        // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ，type 属性将失效 ，仅支持 ['top','left','bottom','right','center']
        this.$refs['popup'].open('bottom');
      },
      openProdct() {
        this.$refs['prodPopup'].open('bottom');
      },
      // 获取司机最新运单详情
      async getLatestWayBill(type) {
        try {
          let res = await getWayBillDetailLatest({
            tenantId: getTenantId(),
            Authorization: 'Bearer ' + getAccessToken()
          }, { businessType: uni.getStorageSync('orderType') });
          if (res.code == 0) {
            if (!!res.data) {
              //有数据则判断运单状态
              let status = res.data.waybillStatus;
              this.orderStatus = status
              if (res.data.planType == 1) {
                //采购
                if (status === 0) {
                  this.$tab.reLaunch(`/pages/waybill?type=deliver`);
                } else if (status === 9) {
                  //已终止的状态
                  this.showMessageForDriver();
                } else {
                  if (this.lineupSwitch == 1) {
                    toast('当前运单不支持排号');
                    return
                  }
                  this.getWayBillDetails(res.data.waybillNo, type);
                }
              } else {
                //销售
                if (status === 0) {
                  this.$tab.reLaunch(`/pages/waybill?type=pull`);
                } else if (status === 7 || status === 8) {
                  //已终止的状态
                  this.showMessageForDriver();
                } else {
                  if (this.saleLineupSwitch == 1) {
                    toast('当前运单不支持排号');
                    return
                  }
                  this.getWayBillDetails(res.data.waybillNo, type);
                }
              }
            } else {
              //无数据
              toast(`您暂时没有运单，请先接单！`);
            }
          } else {
            if (!getAccessToken()) {
              toast('请先登录，获取更多数据');
            }
          }
        } catch (e) {
          return false;
        }
      },
      showMessageForDriver() {
        toast('您当前没有正在执行中的运单！');
        this.waybillDialogDetailFlag = false;
        this.waybillFinishDialogFlag = false;
        this.showIcon = false;
      },
      //获取车辆列表
      async getCarList() {
        try {
          //遍历对象过滤空值
          let data = {
            pageNo: 1,
            pageSize: 100
          };
          let res = await getVehicle(data);
          if (res.code == 0) {
            this.vehicleList = res.data.list;
          }
        } catch (e) {
          return false;
        }
      },
      async handlePaiduiConfirm() {
        this.$refs.mapRefs.getLocations();
        if (this.isJtDistance) {
          toast(`在禁停区域内不能排队`);
          return;
        }
        if (!this.isPdDistance) {
          toast(`未在排队区域内，请行驶到排队区域内排队`);
          return;
        }
        try {
          if (this.isLoading) return;
          this.isLoading = true;
          if (this.needPayment) {
            if (this.servicePayFlag || this.priceNum > 0) {
              this.$refs['linePaymentPop'].open('bottom');
            } else {
              await this.handlePaidui();
            }
          } else {
            await this.handlePaidui();
          }
        } finally {
          this.isLoading = false
        }
      },
      async handlePaidui() {
        const res = await creatLineUp({
          waybillNo: this.waybillNo,
          lineupCost: Number(this.priceNum) * 100,
          notifyCost: this.servicePayFlag ? Number(this.notifyCost) * 100 : 0,
          // preLineupNo: this.preLineupNo,
          lineupCost: Number(this.priceNum) * 100 || 0,
          businessType: uni.getStorageSync('orderType'),
          notifyCost: this.servicePayFlag ? Number(this.notifyCost) * 100 : 0
        });
        if (res.code == 0) {
          if (uni.getStorageSync('orderType')) {
            this.getLatestWayBill('');
          }
        } else {
          toast(`${res.msg}`);
        }
      },
      async getWayBillDetails(id, type) {
        try {
          let res = await getLineUpDetail({
            waybillNo: id,
            businessType: uni.getStorageSync('orderType')
          });
          if (res.code == 0) {
            this.payCallNotifyStatus = res.data.payCallNotifyStatus;
            this.payCallNotifyStatusName = this.payCallNotifyStatusList.find(item => parseInt(item.value) === this.payCallNotifyStatus)?.text || '未知状态';
            this.lineupId = res.data.lineupVO.id;
            this.waybillqueueStatus = res.data.lineupVO.queueStatus;
            let waybillStatus = res.data.lineupVO.queueStatus;
            if (waybillStatus <= 40030) {
              uni.setStorageSync('checkPositionOrNullFlag', true);
            } else {
              uni.setStorageSync('checkPositionOrNullFlag', false);
            }
            //百吉的情况
            uni.setStorageSync('waybillResId', res.data.lineupVO.id);
            let lineupSwitch = res.data.lineupSwitch;
            this.isNeedLineup = res.data.lineupSwitch == 1 ? false : true;

            let currentFlag = false;
            let isFromCode = true; //从接单过来且状态是已入场之后，展示已完成的详情
            this.waybillStatusPay = false;
            this.waybillNo = res.data.lineupVO.waybillNo;

            if (
              waybillStatus == 10010 ||
              waybillStatus == 40020 ||
              waybillStatus == 10000
            ) {
              // 已预约/已取消排队
              this.waybillStatusName = 1;
            } else if (waybillStatus == 40010) {
              // 已排队
              this.waybillStatusName = 1;
            } else if (waybillStatus == 30010) {
              //排队未支付
              this.waybillStatusName = 1;
              // this.priceNumText = '排号10元'
              this.waybillStatusPay = true;
            } else {
              // 除已预约取消排队，已排队外的其余
              if (
                waybillStatus == 90000 ||
                waybillStatus == 60040 ||
                waybillStatus == 40050
              ) {
                currentFlag = true;
              }
              if (waybillStatus == 40050) {
                isFromCode = false;
              }
              this.waybillStatusName = 0;
              this.carListFlag = true;
            }
            this.resetWaybillData();
            if (
              this.waybillStatusName == 0 &&
              type == 'code' &&
              currentFlag &&
              isFromCode
            ) {
              // 展示接单页面
              this.carListFlag = false;
              this.getTransPlanData(uni.getStorageSync('ysjhData').planId);
            } else {
              //设置支付参数
              this.preLineupNo = res.data.preLineupNo;
              this.needPayment = res.data.needPayment;
              this.notifyCost = 0;
              this.priceNum = 0;
              this.totalPrice = 0;
              this.servicePayFlag = false;
              this.priceNumText = '排号';
              if (res.data.notifyCost != null) {
                if (res.data.notifyCost !== 0) {
                  this.notifyCost = parseFloat(res.data.notifyCost / 100).toFixed(
                    2
                  );
                }
              }
              if (res.data.lineupCost != null) {
                if (res.data.lineupCost !== 0) {
                  this.getLinePay(res.data.lineupCost);
                }
              }
              this.waybillData.currentLineupCount = res.data.currentLineupCount;
              this.waybillData.hours = res.data.hours;
              this.waybillData.minutes = res.data.minutes;
              this.goodsType =
                res.data.lineupVO.queueType == 2 ? 'sale' : 'phurchase';
              // this.waybillData.waybillRespVO.shippersId = res.data.waybillRespVO.shippersId
              // this.waybillData.waybillRespVO.shippersName = res.data.waybillRespVO.shippersName
              this.waybillData.waybillRespVO.waybillNo =
                res.data.lineupVO.waybillNo;
              this.waybillData.waybillRespVO.carBrand =
                res.data.lineupVO.vehicleNo;
              this.waybillData.waybillRespVO.waybillNo =
                res.data.lineupVO.queueStatus;
              this.waybillData.waybillRespVO.waybillStatusName =
                res.data.lineupVO.queueStatusName;
              this.waybillData.waybillRespVO.waybillStatus =
                res.data.lineupVO.queueStatus;
              this.waybillData.waybillRespVO.supplierName =
                res.data.lineupVO.supplierName;
              this.waybillData.waybillRespVO.loadingSiteName =
                res.data.lineupVO.loadingSiteName;
              this.waybillData.waybillRespVO.coalSubtypeName =
                res.data.lineupVO.coalSubtypeName;
              // this.waybillData.waybillRespVO.planType = res.data.lineupVO.planType;
              this.waybillData.waybillRespVO.carName =
                res.data.lineupVO.driverName;
              this.waybillData.waybillRespVO.customerName =
                res.data.lineupVO.customerName;
              this.waybillData.waybillRespVO.purchaserName =
                res.data.lineupVO.purchaserName;
              this.waybillData.waybillRespVO.userId = res.data.lineupVO.driverId;
              this.waybillData.waybillRespVO.carPhone =
                res.data.lineupVO.driverMobile;
              // this.waybillData.waybillRespVO.driverId = res.data.waybillRespVO.driverId;
              // this.waybillData.waybillRespVO.uuid = res.data.lineupVO.loadingWeighbridge;
              if (res.data.lineupVO.queueType == 2) {
                this.waybillData.waybillRespVO.unLoadingSiteName =
                  res.data.lineupVO.unLoadingSiteName;
              }
              this.currentStatus = false;
              if (!currentFlag) {
                // 展示接单后的状态页面
                this.currentWIndow = 2;
                this.waybillDialogDetailFlag = true;
              } else {
                // 展示已完成页面
                this.currentWIndow = 3;
                this.waybillFinishDialogFlag = true;
              }
              this.curType = 2;
              this.violationsCancel();
            }
          } else {
            toast(`${res.msg}`);
            this.errorMsg = res.msg;
          }
        } catch (e) {
          return false;
        }
      },
      resetWaybillData() {
        this.waybillData = {
          waybillRespVO: {
            id: undefined,
            planNo: undefined,
            customerName: undefined,
            purchaserName: undefined,
            enterId: undefined,
            openId: undefined,
            supplierName: undefined,
            waybillNo: undefined,
            planType: 1,
            planTypeName: undefined,
            loadingSiteId: undefined,
            loadingSiteName: undefined,
            unLoadingSiteId: undefined,
            unLoadingSiteName: undefined,
            bizType: 0,
            carBrand: undefined,
            carCard: undefined,
            driverId: undefined,
            carName: undefined,
            carPhone: undefined,
            dateDb: undefined,
            driverWeight: 0,
            proId: undefined,
            supId: undefined,
            userId: undefined,
            uuid: undefined
          },
          hours: 0,
          minutes: 0,
          currentLineupCount: 0,
          enableStatus: undefined //状态
        };
      },
      async getTransPlanData(id) {
        uni.setNavigationBarTitle({
          title: '接单'
        });
        let _ = this;
        _.curType = 2;
        _.getCarList();
        uni.removeStorageSync('vehicleNoByCode');
        uni.removeStorageSync('loadingWeighbridgeByCode');
        _.resetWaybillData();
        try {
          let res = await getTransPlanDetail(id);
          _.currentStatus = true;
          if (res.code == '200') {
            let dateRes = getCurrenDate();
            _.curDateTime =
              dateRes.curYear +
              '-' +
              dateRes.curMonth +
              '-' +
              dateRes.curDay +
              ' ' +
              dateRes.curHour +
              ':' +
              dateRes.curMinute +
              ':' +
              dateRes.curSecond;
            // 运输计划详情
            uni.removeStorageSync('currentLinePageData');
            uni.setStorageSync('currentLinePageData', res.data);
            uni.setStorageSync('curUserId', res.data.userId);
            let driverInfo = uni.getStorageSync('sjxxData');
            _.carListFlag = false;
            _.waybillDialogFlag = true;
            _.waybillData.waybillRespVO.id = res.data.id;
            _.waybillData.waybillRespVO.supplierName = res.data.supName;
            _.waybillData.waybillRespVO.customerName = res.data.customerName;
            _.waybillData.waybillRespVO.purchaserName = res.data.purchaserName;
            _.waybillData.waybillRespVO.loadingSiteId = res.data.loadingSiteId;
            _.waybillData.waybillRespVO.loadingSiteName =
              res.data.loadingSiteName;
            this.waybillData.waybillRespVO.coalSubtypeName =
              res.data.coalSubtypeName;
            _.waybillData.waybillRespVO.planType = res.data.planType;
            _.waybillData.waybillRespVO.carName = driverInfo.driverName;
            _.waybillData.waybillRespVO.carCard = driverInfo.idNo;
            _.waybillData.waybillRespVO.driverId = driverInfo.id;
            _.waybillData.waybillRespVO.carPhone = driverInfo.mobile;
            _.currentWIndow = 1;
            uni.setStorageSync('supIdFlag', res.data.supId);
          }
        } catch (e) {
          return false;
        }
      },
      goToMyLine() {
        this.curType = 2;
        this.switchText = '排号列表';
        this.waybillDialogFlag = false;
        this.parkigDetailFlag = false;
        if (uni.getStorageSync('orderType')) {
          this.getLatestWayBill('');
        }
      },
      async getWayBillDetailForDriver() {
        try {
          const res = await getWayBillDetailForDriver();
          if (res.code == 0) {
            if (!!res.data) {
              //有数据则判断运单状态
              let status = res.data.waybillStatus;
              if (res.data.planType == 1) {
                //采购
                if (status === 0) {
                  this.$tab.reLaunch(`/pages/waybill?type=deliver`);
                } else if (status === 9) {
                  //已终止的状态
                  this.showMessageForDriver();
                } else {
                  this.getWayBillDetails(res.data.waybillNo, type);
                }
              } else {
                //销售
                if (status === 0) {
                  this.$tab.reLaunch(`/pages/waybill?type=pull`);
                } else if (status === 7 || status === 8) {
                  //已终止的状态
                  this.showMessageForDriver();
                } else {
                  this.getWayBillDetails(res.data.waybillNo, type);
                }
              }
            } else {
              //无数据
              toast(`您暂时没有运单，请先接单！`);
            }
          } else {
            if (!getAccessToken()) {
              toast('请先登录，获取更多数据');
            }
          }
        } catch (e) {
          return false;
        }
      },
      onPullDownRefresh() {
        this.findLineupSwitchByTenant();
        this.parkigDetailFlag = false;
        this.pageParams.isMore = 'more';
        if (this.checkItemId == 1) {
          this.queryParam.pageNo = 1;
          this.rowNumberData = [];
          this.getRowList();
        } else {
          this.queryParamParking.pageNo = 1;
          this.parkigDatas = [];
          this.getParkingList();
        }
      },
      confirmChange(data) {
        this.queryParam.pageNo = 1;
        this.rowNumberData = [];
        this.queryParam.startTime = data.startTime;
        this.queryParam.endTime = data.endTime;
        this.getRowList();
      },
      searchList(param) {
        if (this.checkItemId == 1) {
          this.queryParam.pageNo = 1;
          this.rowNumberData = [];
          this.queryParam.startTime = param.startTime;
          this.queryParam.endTime = param.endTime;
          this.queryParam.vehicleNo = param.vehicleNo;
          this.getRowList();
        } else {
          this.queryParamParking.pageNo = 1;
          this.queryParamParking.vehicleNo = param.vehicleNo || '';
          this.getParkingList();
        }
      },
      onReachBottom() {
        if (this.pageParams.isMore == 'more') {
          if (this.checkItemId == 1) {
            this.queryParam.pageNo++;
            this.getRowList();
          } else {
            this.queryParamParking.pageNo++;
            this.getParkingList();
          }
        }
      },
      // 获取登录状态
      async getLoginStatus() {
        // 判断登录状态是获取atoken
        if (getAccessToken()) {
          // 已经登录
          this.rowNumberData = [];
          this.getRowList();
        }
      },
      //获取排号信息列表
      async getRowList() {
        this.parkigDetailFlag = false;
        try {
          //遍历对象过滤空值
          let data = {};
          Object.keys(this.queryParam).forEach((item) => {
            if (this.queryParam[item]) {
              data[item] = this.queryParam[item];
            }
          });
          this.pageParams.isMore = 'loading';
          let res = await getLineUpByDriver(data);
          if (res.code == 0) {
            if (this.queryParam.pageNo == 1) {
              this.rowNumberData = res.data.list;
            } else {
              this.rowNumberData = [...this.rowNumberData, ...res.data.list];
            }
            if (res.data.total == this.rowNumberData.length) {
              this.pageParams.isMore = 'noMore';
            } else {
              this.pageParams.isMore = 'more';
            }
          } else {
            this.rowNumberData = [];
            this.pageParams.isMore = 'noMore';
          }
          //停止下拉刷新
          wx.hideNavigationBarLoading();
          //停止下拉刷新
          wx.stopPullDownRefresh();
        } catch (e) {
          return false;
        }
      },
      async getDictLists() {
        let datas = await getDictDatas();
        let res = await dictTansParams(datas.data, 'payCallNotifyStatus');
        this.payCallNotifyStatusList = res.map((item) => {
          return {
            value: item.value,
            text: item.text
          };
        });
      },
      async getPreLineupNo() {
        const res = await getWayBillDetailLatest({
          tenantId: getTenantId(),
          Authorization: 'Bearer ' + getAccessToken()
        }, { businessType: uni.getStorageSync('orderType') });
        if (res.code !== 0) {
          return toast(res.msg);
        }
        const waybillNo = res.data.waybillNo
        const suc = await getLineUpDetail({
          waybillNo,
          businessType: uni.getStorageSync('orderType')
        });
        if (suc.code !== 0) {
          return toast(suc.msg);
        }
        this.preLineupNo = suc.data.preLineupNo;
      }
    },
    async onLoad(options) {
      await this.getDictLists();
      uni.setStorageSync('jTNum', 0);
      this.planId = uni.getStorageSync('ysjhData').planId;
      await this.findLineupSwitchByTenant();
      this.gettenantConfig();
      if (!!options) {
        if (JSON.stringify(options) == '{}') {
          this.curType = 1;
          return;
        }
        if (!!options.chargeLine && uni.getStorageSync('orderType')) {
          this.getLatestWayBill('line');
          return;
        }
        if (!!options.carno) {
          this.curType = 2;
          this.haveOpt = 2;
          this.carBrand = options.carno;
          if (uni.getStorageSync('orderType')) {
            this.getLatestWayBill('');
          }
          // this.$refs['jdcgPop'].open('bottom');
          // this.startCountdown()
          return;
        }
        if (!!options.codes) {
          this.curType = 2;
          this.haveOpt = 2;
          //是从接单过来的
          this.getWayBillDetails(options.id, 'code');
          return;
        }
        if (options.lineup == 1 && uni.getStorageSync('orderType')) {
          this.curType = 2;
          this.haveOpt = 2;
          this.getLatestWayBill('line');
          return;
        }
      } else {
        this.haveOpt = 2;
        this.curType = 1;
        //去显示排号列表
        this.getLoginStatus();
      }
    },
    async onShow() {
      if (this.haveOpt === 1 || this.haveOpt === 0) {
        this.queryParam.pageNo = 1;
        this.curType = 1;
        this.getLoginStatus();
      }
      this.findLineupSwitchByTenant();
      this.$refs['linePaymentPop'].close();
      this.servicePayFlag = false;
      this.isNotifyShow = false
    },
    onHide() {
      this.haveOpt = 0;
      this.curType = 0;
      // this.$refs['jdcgPop']?.close()
    }
  };
</script>

<style lang="scss" scoped>
  .call-reminder-box {
    display: flex;
    align-items: center;
    margin-bottom: 10rpx;

    .tap-box {
      display: flex;
      align-items: center;

      image {
        margin-right: 10rpx;
      }
    }
  }

  .back-meng {
    background: rgba(0, 0, 0, 0.6);
    position: fixed;
    top: 0;
    z-index: 8;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .content {
    background: #fff;

    .phxx-list {
      background-color: #f1f2f5;
      padding-top: 16rpx;
    }

    .phxx-itemss {
      box-sizing: border-box;
      background: #fff;
      border-radius: 30rpx;

      .header {
        width: 100%;
        height: 96rpx;
        line-height: 96rpx;
        border-bottom: 2rpx solid #eaeaea;
        text-align: center;
        color: #000;
        font-size: 16px;
        font-weight: 600;
      }

      .top {
        padding: 30rpx;
        font-size: 15px;

        .tit {
          margin-bottom: 20rpx;
        }
      }
    }

    .payment-box {
      position: absolute;
      color: red;
      z-index: 10;
      font-size: 8px;
      bottom: 1px;
      left: 40%;
    }

    .refresh-btn {
      position: fixed;
      top: 10px;
      right: 5px;
      color: #409efe;
      height: 25px;
      line-height: 25px;
      text-align: center;
      padding: 0 10px;
      border-radius: 7px;
      font-weight: bold;
    }

    .message {
      border-radius: 50px;
      position: fixed;
      left: 50%;
      /* 水平居中 */
      transform: translateX(-50%);
      /* 水平居中 */
      width: 95%;
      /* 宽度为屏幕的90% */
      z-index: 10;
      /* 确保在其他元素之上 */
    }

    .refresh-btn:hover {
      cursor: pointer;
    }

    .tips-box {
      position: fixed;
      top: 10px;
      color: #000;

      >view {
        height: 25px;
        line-height: 25px;
        text-indent: 10px;

        .icon {
          width: 20px;
          height: 20px;
          border-radius: 10px;
          display: inline-block;
          top: 5px;
          margin-right: 6px;
          position: relative;
        }
      }

      .lineup {
        .icon {
          background: #1b84d055;
        }
      }

      .nostop {
        .icon {
          background: #e50b2555;
        }
      }
    }

    .shousuo,
    .shousuo-up {
      position: absolute;
      width: 48px;
      background: #fff;
      top: -14px;
      left: 50%;
      margin-left: -27px;
      height: 14px;
      border-top-left-radius: 30rpx;
      border-top-right-radius: 30rpx;

      .back {
        background: transparent;
        position: absolute;
      }

      .back-left {
        left: 0;
      }

      .back-right {
        right: 0;
      }

      image {
        width: 48px;
        height: 25rpx;
        top: 4px;
        left: 0px;
      }
    }

    .shousuo-up {
      position: fixed;
      bottom: -2px;
      top: auto;
    }

    .shousuo:hover,
    .shousuo-up:hover {
      cursor: pointer;
    }

    .work-container {
      font-size: 14px;
    }

    .btn-waybill {
      overflow: hidden;
      margin-top: 10px;
    }

    .lineRulePop-box {
      background: #fff;
      z-index: 999999;
      padding: 33rpx;
      border-radius: 5rpx;

      .tit1 {
        height: 65rpx;

        .uniui-closeempty {
          float: right;
        }
      }

      .tit {
        min-height: 37rpx;
        padding: 8rpx 0;
      }
    }

    .btns {
      background-color: #409efe;
      height: 35px;
      line-height: 35px;
      position: relative;
      font-size: 14px;
      width: 172rpx;
      color: #fff;
      top: -4rpx;
      padding: 0;
    }

    .waybill-box {
      border-top: 1rpx solid #dcdcdc;
      padding: 30rpx 20rpx 20rpx 20rpx;
    }

    ::v-deep.jdcgPop {
      background-color: #fff;
      width: 750rpx;
      height: 450rpx;

      .top {
        background-color: #fff;
        width: 750rpx;
        font-size: 14px;
        padding: 20rpx;

        .title-box {
          border-bottom: 1px dashed #ccc;
          padding-bottom: 20rpx;
          text-align: center;
          font-size: 18px;
          color: #000;
          font-weight: bold;

          .tit {
            padding: 15rpx 0;
          }

          .tit1 {
            image {
              width: 218rpx;
              height: 188rpx;
            }
          }
        }

        .body {
          font-size: 15px;
          color: #666;
          padding: 20rpx 0 0 0;

          .tit {
            padding-bottom: 20rpx;

            .icon {
              width: 16rpx;
              height: 16rpx;
              background: rgba(64, 158, 254, 0.5);
              display: inline-block;
              border-radius: 50%;
              position: relative;
              margin-right: 10rpx;
              bottom: 2rpx;

              .icon-inner {
                position: relative;
                background-color: #409efe;
                width: 8rpx;
                height: 8rpx;
                border-radius: 50%;
                top: 2px;
                left: 5rpx;
              }
            }

            .dat {
              position: relative;
              padding-right: 30rpx;
              display: inline-block;

              text {
                position: absolute;
                display: inline-block;
                left: 0;
                top: -15rpx;
                width: 8rpx;
                height: 8rpx;
                border-radius: 10rpx;
                background-color: #000000;
              }
            }
          }
        }
      }
    }

    ::v-deep.carPop {
      background-color: #fff;
      width: 750rpx;
      height: 500rpx;

      .carList {
        border-radius: 10rpx;
        padding: 10rpx;
        background-color: #fff;
        width: 750rpx;
        height: 500rpx;
        overflow: auto;
        font-size: 14px;

        .top {
          display: flex;
          justify-content: space-between;
          padding: 0 16rpx;
          height: 40px;
          line-height: 40px;
        }

        .a-i-c {
          .item-box {
            height: 50rpx;
            line-height: 50rpx;
            box-sizing: content-box;
            padding: 20rpx;
            border-bottom: 1px solid #ccc;
            display: flex;
            justify-content: space-between;

            .cph {
              font-weight: bold;
            }

            .status {}

            .isReal {
              color: #fff;
              padding: 10rpx;
              background-color: #19be6b;
              border-radius: 6rpx;
              line-height: 50rpx;
            }

            .isnotReal {
              color: #fff;
              padding: 10rpx;
              background-color: #f56c6c;
              border-radius: 6rpx;
              line-height: 50rpx;
            }

            .goReal {
              color: #fff;
              margin-left: 40rpx;
              padding: 10rpx;
              background-color: #1890ff;
              border-radius: 6rpx;
              line-height: 50rpx;
            }
          }
        }
      }
    }

    .waybill-details {
      position: fixed;
      bottom: 0;
      width: 100%;
      z-index: 9;
    }

    .wpdformBg {
      box-sizing: border-box;
      padding: 30rpx;
      background-color: #fff;
      color: #000;
      font-size: 14px;

      .btn-box {
        overflow: hidden;
        position: relative;
      }

      .phxx {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 96rpx;
        padding-bottom: 30rpx;
        border-bottom: 1px solid #e6e6e6;
        font-size: 14px;
        color: #333;

        .cph {
          font-weight: 700;
          font-size: 18px;
          color: #000;
          padding-bottom: 5rpx;
        }

        .line {
          color: #409efe;
        }

        .status {
          padding: 0 20rpx;
          text-align: center;
          border-radius: 10rpx;
          display: block;
          height: 45rpx;
          line-height: 45rpx;
        }

        .red-status {
          background: #fc1a0c !important;
        }

        .green-status {
          background: #37a134 !important;
        }
      }

      .yjddss {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20rpx;

        .item {
          background: #f1f2f5;
          width: 49.2%;
          text-align: center;
          padding: 20rpx 0;
          line-height: 40rpx;

          .til {
            font-size: 13px;
            color: #999;
          }

          .val {
            color: #000;
            font-size: 20px;
          }
        }
      }

      .phgz {
        padding: 0 20rpx;
        font-size: 30rpx;
        word-spacing: 10rpx;
      }

      .phgzxx {
        font-size: 30rpx;
        padding: 0 20rpx 30rpx;
      }
    }

    .wpdformBg1 {
      box-sizing: border-box;
      padding: 30rpx;
      background-color: #fff;
      color: #000;
      overflow-y: auto;
      max-height: 550px;
      font-size: 14px;
      padding-bottom: 50px;

      .btn-box {
        overflow: hidden;
        position: relative;
      }

      .phxx {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 96rpx;
        padding-bottom: 30rpx;
        border-bottom: 1px solid #e6e6e6;
        font-size: 14px;
        color: #333;

        .cph {
          font-weight: 700;
          font-size: 18px;
          color: #000;
          padding-bottom: 5rpx;
        }

        .line {
          color: #409efe;
        }

        .status {
          padding: 0 20rpx;
          text-align: center;
          border-radius: 10rpx;
          display: block;
          height: 45rpx;
          line-height: 45rpx;
        }

        .red-status {
          background: #fc1a0c !important;
        }

        .green-status {
          background: #37a134 !important;
        }
      }

      .yjddss {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20rpx;

        .item {
          background: #f1f2f5;
          width: 49.2%;
          text-align: center;
          padding: 20rpx 0;
          line-height: 40rpx;

          .til {
            font-size: 13px;
            color: #999;
          }

          .val {
            color: #000;
            font-size: 20px;
          }
        }
      }

      .phgz {
        padding: 0 20rpx;
        font-size: 30rpx;
        word-spacing: 10rpx;
      }

      .phgzxx {
        font-size: 30rpx;
        padding: 0 20rpx 30rpx;
      }
    }

    .uni-form-item {
      display: flex;
      justify-content: space-between;
      line-height: 40px;
      height: 40px;

      .title {
        width: 25%;
        text-align: right;
      }

      .val {
        width: 75%;
      }

      .uni-input {
        flex: 3;
        padding-left: 10rpx;
      }

      .uni-input.vehicleno {
        border: 1px solid #ccc;
        background-color: #f2f2f2;
        height: 40px;
      }

      .uni-input.prd-mess {
        border-bottom: 1px solid #ccc;
        border-radius: 0;
        height: 40px;
        text-align: right;
      }

      .cover-img {
        border: 1rpx #ccc solid;
      }

      .cover-img,
      .cover-defaultImg {
        width: 100rpx;
        height: 100rpx;
        display: inline-block;
        margin-left: 0rpx;
        border-radius: 10px;
      }

      .img-box {
        flex: 3;
      }

      .cover-defaultImg {
        margin-left: 10rpx;
      }
    }

    .ypdformBg {
      padding: 20rpx;
      background-color: #ffffff;

      .phxx {
        display: flex;
        justify-content: space-between;
        height: 60rpx;
        padding: 20rpx 30rpx;
        box-sizing: content-box;
        border-bottom: 1px solid #797979;

        .cph {
          color: #999;
          font-weight: 700;
        }

        .status {
          margin-right: 40rpx;
          color: #fff;
          padding: 0 20rpx;
          line-height: 50rpx;
          height: 50rpx;
          text-align: center;
          border-radius: 10rpx;
          border: 1px solid #e8b70a;
          background: #e8b70a;
          display: block;
        }
      }

      .bdxx {
        .title {
          color: #ccc;
        }
      }
    }

    .float-button {
      position: fixed;
      right: 15rpx;
      bottom: 110rpx;
      width: 55rpx;
      height: 55rpx;
      border-radius: 50%;
      background: #39b54a;
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 4rpx 4rpx 15rpx rgba(0, 0, 0, 0.4);
      z-index: 999;
    }

    .hover-btn-bg {
      background-color: green;
      color: #fff;
    }

    .phxx-list {
      padding: 20rpx;

      .btn-box {
        width: 100%;
        height: 39px;
        display: flex;
        justify-content: flex-end;
      }
    }
  }

  .loading {
    position: relative;
  }

  .loading-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 29%;
    left: 36%;
    transform: translate(-50%, -50%);
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  .disabled-button {
    opacity: 0.5;
    /* 按钮置灰 */
    pointer-events: none;
    /* 禁止点击 */
  }

  .queue-num-status {
    position: relative;
  }

  ::v-deep .uni-noticebar {
    border-radius: 15px !important;
  }
</style>